/*!
 Temelia - generic library - samples common interface.

 Copyright (C) 2008 Ceata (http://ceata.org/proiecte/temelia).

 @author Dascalu Laurentiu

 This program is free software; you can redistribute it and
 modify it under the terms of the GNU General Public License
 as published by the Free Software Foundation; either version 3
 of the License, or (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#ifndef SAMPLES_COMMON_H_
#define SAMPLES_COMMON_H_

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>

#include <temelia/common.h>

#define MAX_TEST_LENGTH	35
#define PRINT(fmt, args...) printf(fmt, ##args)

/*
 * Test suite front-end functions.
 */
void run_algorithms_samples();
void run_avl_tree_samples();
void run_b_tree_samples();
void run_binary_search_tree_samples();
void run_binary_tree_samples();
void run_doubly_linked_list_samples();
void run_hash_set_samples();
void run_hash_map_samples();
void run_heap_samples();
void run_interval_tree_samples();
void run_linked_list_samples();
void run_matrix_samples();
void run_graph_samples();
void run_graph_matrix_samples();
void run_graph_sparse_matrix_samples();
void run_graph_list_samples();
void run_pair_samples();
void run_queue_samples();
void run_red_black_tree_samples();
void run_scapegoat_tree_samples();
void run_skip_list_samples();
void run_sort_samples();
void run_sparse_matrix_samples();
void run_splay_tree_samples();
void run_stack_samples();
void run_treap_tree_samples();
void run_tree_algorithms_samples();
void run_tree_samples();
void run_trie_tree_samples();
void run_vector_samples();

/*
 * Test suite back-end functions.
 */

// array specific functions
void *my_key_at(void *data, int index);
void my_set_key_at(void *data, int index, void *key);

// int key specific functions
void *int_new(int initial_value);
void int_delete(void *x, void *context);
int int_compare(void *x, void *y, void *context);
void int_handler(void *x, void *fout);
void int_level_handler(void *key, int level, void *fout);

int **int_array_new(int size, int max);
void int_array_delete(int **data, int size);

//general keys functions
void unsigned_int_handler(void *x, FILE *fout);
void double_handler(void *x, FILE *fout);
void string_handler(void *x, void *context);

char *my_strdup(char *str);

#endif /* SAMPLES_COMMON_H_ */
